package com.sptci.rwt;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;

/**
 * An abstract base class analyser for the various database objects.
 *
 * <p>&copy; Copyright 2007 Sans Pareil Technologies, Inc.</p>
 * @author Rakesh Vidyadharan 2007-09-25
 * @version $Id: Analyser.java 2 2007-10-19 21:06:36Z rakesh.vidyadharan $
 */
public abstract class Analyser
{
  /**
   * The connection manager to use to fetch connections.
   */
  protected final ConnectionManager manager;

  /**
   * Create a new instance of the class using the specified connection
   * manager.
   *
   * @param manager The connection manager to use.
   */
  protected Analyser( final ConnectionManager manager )
  {
    this.manager = manager;
  }

  /**
   * Analyse the database connected to and return the appropriate metadata
   * objects.  Returns a collection of metadata objects that represent all
   * the objects of this type available to the user.
   *
   * @param parameters Optional parameters that are required to analyse
   *   objects of this type.
   * @return The collection of metadata objects representing all objects of
   *   this type.
   * @throws SQLException If errors are encountered while analysisng the
   */
  public abstract Collection<? extends MetaData> analyse(
      final MetaData... parameters ) throws SQLException;
}
